package com.insf.poiword.controller;

import com.insf.poiword.service.ArticleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@Controller
public class ArticleController {
    @Resource
    private ArticleService articleService;

    @GetMapping("/exportWord/{id}")
    @ResponseBody
    public String exportWord(@PathVariable String id, HttpServletResponse response) {
        articleService.findArticleByPrimaryKey(id, response);
        return "ok";
    }

}
